import UIKit

@available(iOS, introduced: 2.0, deprecated: 8.3, message: "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead")
extension QKC where AA :UIActionSheet {
     open func delegate_qk_s(_ delegate:  UIActionSheetDelegate?) -> QKC<AA,YY,ZZ, UIActionSheetDelegate?>{
		return link(next: delegate).then_QK { $0.value.delegate = delegate }
	}
     open func delegate_qk_g() -> QKC<AA,YY,ZZ, UIActionSheetDelegate?>{
		 self +^ self.value.delegate
	}

    open func title_qk_s(_ title:  String) -> QKC<AA,YY,ZZ, String>{
		return link(next: title).then_QK { $0.value.title = title }
	}
    open func title_qk_g() -> QKC<AA,YY,ZZ, String>{
		 self +^ self.value.title
	}

		// default is UIActionSheetStyleAutomatic. ignored if alert is visible
    open func actionSheetStyle_qk_s(_ actionSheetStyle:  UIActionSheetStyle ) -> QKC<AA,YY,ZZ, UIActionSheetStyle >{
		return link(next: actionSheetStyle).then_QK { $0.value.actionSheetStyle = actionSheetStyle }
	}
    open func actionSheetStyle_qk_g() -> QKC<AA,YY,ZZ, UIActionSheetStyle >{
		 self +^ self.value.actionSheetStyle
	}

    open func numberOfButtons_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.numberOfButtons
	}

		// if the delegate does not implement -actionSheetCancel:, we pretend this button was clicked on. default is -1
    open func cancelButtonIndex_qk_s(_ cancelButtonIndex:  Int ) -> QKC<AA,YY,ZZ, Int >{
		return link(next: cancelButtonIndex).then_QK { $0.value.cancelButtonIndex = cancelButtonIndex }
	}
    open func cancelButtonIndex_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.cancelButtonIndex
	}

		// sets destructive (red) button. -1 means none set. default is -1. ignored if only one button
    open func destructiveButtonIndex_qk_s(_ destructiveButtonIndex:  Int ) -> QKC<AA,YY,ZZ, Int >{
		return link(next: destructiveButtonIndex).then_QK { $0.value.destructiveButtonIndex = destructiveButtonIndex }
	}
    open func destructiveButtonIndex_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.destructiveButtonIndex
	}

		// -1 if no otherButtonTitles or initWithTitle:... not used
    open func firstOtherButtonIndex_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.firstOtherButtonIndex
	}

    open func isVisible_qk_g() -> QKC<AA,YY,ZZ, Bool >{
		 self +^ self.value.isVisible
	}

	// destructive and cancel button which will be positioned based on HI requirements. buttons cannot be customized.
		// returns index of button. 0 based.
    open func addButton_qk_f(withTitle title: String?) -> QKC<AA,YY,ZZ,Int >{
		 self +^ self.value.addButton(withTitle:title)
	}

    open func buttonTitle_qk_f(at buttonIndex: Int) -> QKC<AA,YY,ZZ,String?>{
		 self +^ self.value.buttonTitle(at:buttonIndex)
	}

	// UIActionSheetStyleDefault if automatic style set
    open func show_qk_f(from view: UIToolbar) -> QKC<AA,YY,ZZ, UIToolbar>{
		 self +^ self.value.show(from:view) +^ view
	}

    open func show_qk_f(from view: UITabBar) -> QKC<AA,YY,ZZ, UITabBar>{
		 self +^ self.value.show(from:view) +^ view
	}

    @available(iOS 3.2, *)
    open func show_qk_f(from item: UIBarButtonItem, animated: Bool) -> QKC<AA,YY,ZZ, UIBarButtonItem>{
		 self +^ self.value.show(from:item, animated:animated) +^ item
	}

    @available(iOS 3.2, *)
    open func show_qk_f(from rect: CGRect, in view: UIView, animated: Bool) -> QKC<AA,YY,ZZ, CGRect>{
		 self +^ self.value.show(from:rect, in:view, animated:animated) +^ rect
	}

    open func show_qk_f(in view: UIView) -> QKC<AA,YY,ZZ, UIView>{
		 self +^ self.value.show(in:view) +^ view
	}

	// it does not need to be called if the user presses on a button
    open func dismiss_qk_f(withClickedButtonIndex buttonIndex: Int, animated: Bool) -> QKC<AA,YY,ZZ, Int>{
		 self +^ self.value.dismiss(withClickedButtonIndex:buttonIndex, animated:animated) +^ buttonIndex
	}

}

